package com.gupaoedu.pattern.strategy;

/**
 * @Auther: tcm
 * @Date: 2020/1/30 11:06
 * @Description:
 */
public class PaymentStrategyFactory {

    static final String ALI_PAYMENT_KEY = "ali";
    static final String JD_PAYMENT_KEY = "jd";
    static final String WECHAT_PAYMENT_KEY = "wechat";

    public static IPaymentStrategy getPaymentStrategy(String strategy_key){
        if(strategy_key.equals(ALI_PAYMENT_KEY)){
            return new AliPayment();
        }else if(strategy_key.equals(JD_PAYMENT_KEY)){
            return new JDPayment();
        }
        return new WeChatPayment();
    }

}
